﻿using Prices;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestPrices
{
    [TestClass()]
    public class PriceIncresedEventArgsTest
    {
        [TestMethod()]
        public void OldPriceTest()
        {
            Decimal oldPrice = 96; // TODO: Initialize to an appropriate value
            Decimal newPrice = 100; // TODO: Initialize to an appropriate value
            PriceIncresedEventArgs target = new PriceIncresedEventArgs(oldPrice, newPrice); // TODO: Initialize to an appropriate value
            Decimal actual;
            actual = target.OldPrice;
            Assert.AreEqual<decimal>(oldPrice, actual);
        }

        [TestMethod()]
        public void NewPriceTest()
        {
            Decimal oldPrice = (decimal)56465.65; // TODO: Initialize to an appropriate value
            Decimal newPrice = (decimal)4546.54; // TODO: Initialize to an appropriate value
            PriceIncresedEventArgs target = new PriceIncresedEventArgs(oldPrice, newPrice); // TODO: Initialize to an appropriate value
            Decimal actual;
            actual = target.NewPrice;
            Assert.AreEqual<decimal>(newPrice, actual);
        }

        [TestMethod()]
        public void PriceIncresedEventArgsConstructorTest()
        {
            Decimal oldPrice = (decimal)5465.9898; // TODO: Initialize to an appropriate value
            Decimal newPrice = (decimal)5465.998; // TODO: Initialize to an appropriate value
            PriceIncresedEventArgs target = new PriceIncresedEventArgs(oldPrice, newPrice);
            Assert.AreEqual<decimal>(oldPrice, target.OldPrice);
            Assert.AreEqual<decimal>(newPrice, target.NewPrice);
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentException), "Product price cannot be negative number ( no gifts )")]
        public void NegativePricesInConstructor()
        {
            decimal oldValue = (decimal)-645.9;
            decimal newValue = (decimal)54654;
            PriceIncresedEventArgs target = new PriceIncresedEventArgs(oldValue, newValue);

            oldValue = (decimal)4654645;
            newValue = (decimal)-6655.545;
            target = new PriceIncresedEventArgs(oldValue, newValue);
        }
    }
}
